<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/back/Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/back/Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo $this->url->getBaseUri() ?>public/back/Css/style.css" />
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/jquery.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/bootstrap.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/ckform.js"></script>
    <script type="text/javascript" src="<?php echo $this->url->getBaseUri() ?>public/back/Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }
        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


    </style>
</head>
<body>
<form  id='frm1' class="form-inline definewidth m20" action="<?php echo $this->url->getBaseUri()."admin/cworder/search" ;?>" method="post">  
    用户id：
    <input type="text" name="rolename" id="rolename"class="abc input-default" placeholder="" value="">&nbsp;&nbsp;  
    <button type="submit"  class="btn btn-primary">查询</button>&nbsp;&nbsp; 
 <select name="parentid" id="select">
 <option value="0">----仓位状态查询</option>
 <option value='1'   />&nbsp;已经使用的仓位</option>
 <option value='2'   />&nbsp;没有使用的仓位</option>
 <option value='3'   />&nbsp;过期仓位</option>
 </select>
 <button type="button" class="btn btn-primary">全部删除</button>
 </form>
<table id="table1" class="table table-bordered table-hover definewidth m10" >
    <thead>
    <tr>
    <td><input type='checkbox' onclick='checkAll(this.checked)'></td>
    <th>id</th>
     <th>用户id</th>
    <th>地区</th>
    <th>运送方式</th>
    <th>运送种类</th>
    <th>重量</th> 
    <th>仓位数量</th>
    <th>价格</th>
    <th>截止期限</th>
    <th>详情</th>
    <th>仓位状态</th>
    <th>编辑</th>
    </tr>
    </thead>
    <?php
         foreach ($status as $value) {
       
    
      ?>
       <tr class="tdd">
      <td><input type='checkbox' name='ids[]' value=''></td>
      
      <td><?php echo $value['id']  ;?></td>
      <td><?php echo $value['uid'] ;?></td>
      <td><?php echo $value['area_id']  ;?></td>
      <td><?php echo $value['big_trans_name']  ;?></td>
      <td><?php echo $value['trans_name'] ;?></td>
      <td><?php echo $value['weight']  ;?></td>
      <td><?php echo $value['cw_number']  ;?></td>
      <td><?php echo $value['cw_price'] ;?></td>
      <td><?php echo $value['lastdate']  ;?></td>
      <td><?php echo $value['info'] ;?></td>
      <td><?php echo $value['status']  ;?></td>
      
            <td>
                 
                  <a href="<?php echo $this->url->getBaseUri()."admin/cworder/del/$value->id" ?>">仓位删除</a>
            </td>
        </tr>
       <?php }  ?> 
   
    </table>
    <div class="inline pull-right page">一共
         <?php echo $count;?> 条记录
         <a href='<?php  echo $this->url->getBaseUri() ."admin/cworder/index/?page=".$mycws->first?>'>首页</a>
         <a href='<?php  echo $this->url->getBaseUri() ."admin/cworder/index/?page=". $mycws->before;?>'>上一页</a>
         <?php  for ($i=1; $i<=$mycws->last; $i++) { 
     
         ?>
         <a href='<?php  echo $this->url->getBaseUri() ."admin/cworder/index/?page=". $i;?>'>
         <?php echo $i ;?></a>
         <?php } ?>

         <a href='<?php  echo $this->url->getBaseUri() ."admin/cworder/index/?page=".$mycws->next; ?>'>下一页</a>
         <a href='<?php  echo $this->url->getBaseUri() ."admin/cworder/index/?page=". $mycws->last;?>' >最后一页</a>
    </div>

   
    </body>
    </html>
<script type="text/javascript">
  function checkAll(f){
    var objs=document.getElementsByName('ids[]');
    for(var i=0;i<objs.length;i++){
      objs[i].checked=f;
    
    }
  }
$('#select').change(function() {
var value=$(this).val();
var url="<?php echo $this->url->getBaseUri() .'admin/cworder/cwstatus/' ?>";
$.ajax({
  url: url,
  type: 'get',
  dataType: 'json',
  data: 'value='+value,
  success:function(data){
   //alert(data[0].id);
    $('.tdd').remove();
   //循环的创建元素 然后把ajax的值一个个放入到元素里面
  for(i=0;i<data.length;i++){
  var trr=document.createElement('tr');//创建tr
      trr.setAttribute('class','tdd');//设置tr属性
  var tds=document.createElement('td');
  var inputs=document.createElement('input');
      inputs.setAttribute('type','checkbox');
      inputs.setAttribute('name','ids[]');
      inputs.setAttribute('value','');
      tds.appendChild(inputs);
      trr.appendChild(tds);
  var tds1=document.createElement('td');
      tds1.innerHTML=data[i].id;
      trr.appendChild(tds1);
  var tds2=document.createElement('td');
      tds2.innerHTML=data[i].uid;
      trr.appendChild(tds2);
  var tds3=document.createElement('td');
      tds3.innerHTML=data[i].area_id;
      trr.appendChild(tds3);
  var tds4=document.createElement('td');
      tds4.innerHTML=data[i].big_trans_name;
      trr.appendChild(tds4);
  var tds5=document.createElement('td');
      tds5.innerHTML=data[i].trans_name;
      trr.appendChild(tds5);
  var tds6=document.createElement('td');
     tds6.innerHTML=data[i].weight;
     trr.appendChild(tds6);
  var tds7=document.createElement('td');
     tds7.innerHTML=data[i].cw_number;
     trr.appendChild(tds7);
  var tds8=document.createElement('td');
     tds8.innerHTML=data[i].cw_price;
     trr.appendChild(tds8);
  var tds9=document.createElement('td');
     tds9.innerHTML=data[i].lastdate;
     trr.appendChild(tds9);
  var tds10=document.createElement('td');
     tds10.innerHTML=data[i].info;
     trr.appendChild(tds10);
  var tds11=document.createElement('td');
     tds11.innerHTML=data[i].status;
     trr.appendChild(tds11);
  var tds12=document.createElement('td');
    tds12.innerHTML='<a href="<?php echo $this->url->getBaseUri()."admin/cworder/del/'+data[i].id+'" ?>">仓位删除</a>';
    trr.appendChild(tds12);
  document.getElementById('table1').appendChild(trr);
}
 

  }




})














});

</script>
